package com.lemon.exam.common.config;

import com.lemon.exam.common.properties.MinioProperties;
import io.minio.MinioClient;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 类对象
 *
 * @author Lemon
 * @since 2025/11/1 20:42
 */
@Configuration
@AutoConfigureAfter(MinioProperties.class)
public class MinioConfiguration {
    @Bean
    public MinioClient minioClient(MinioProperties minioProperties) {
        return MinioClient.builder()
                .endpoint(minioProperties.getEndpoint())
                .credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
                .build();
    }
}
